This note contains info about the sample code that accompanies the develop Issue 13 article, "Video Digitizing Under QuickTime", by Casey King and Gary Woodcock.
There 12 files included in the sample code folder:
HackTV.π Think C project file for the HackTV preview/record application
HackTV.c source code for the HackTV preview/record application
HackTV.π.rsrc resource file for the HackTV preview/record application
Hack TV HackTV standalone application
softVdig.π Think C project file for the standalone softvdig component
softVdig softvdig component extension
softVdig.c source code for the softvdig component
softVdig.h header file for the softvdig component
softVdig.π.rsrc resource file for the softvdig component
HackTVDebug.π Think C project file to run HackTV and softvdig linked
HackTVDebug.π.rsrc resource file for this project
Hack TV Debug standalone application that contains app & component
There are 2 modes of running this code, linked and standalone.
The linked version is the easiest. Simply run the HackTVDebug application or build the HackTVDebug.π project.
To run the standalone version, use the Reinstaller II application to install the softVdig (the component extension). You can use Things! to verify that the softVdig is installed and is the default component. Launch HackTV which will find the softVdig component and the frame burning will start.
Once launched, you should see a monitor window. The frame number in the Monitor window will be incrementing.
You can resize the Monitor window by using the Quarter Size, Half Size, and Full Size menu items from the Monitor menu.
HackTV also allows you to access the sequence grabber panel components. Select the Video Settings ... menu item from the Monitor menu. Select the source panel, and adjust the color controls. The controls will move and stick, but you will not notice any change in the monitor window.
To record a movie, select the Record menu item from the Monitor menu. Recording will start immediately. To terminate recording, depress the mouse button inside the Monitor window. A movie, named Hack Movie, will be created and placed on your desktop. You can play this movie with MoviePlayer.
The softVdig can be reconfigured by modifying the defines in softVdig.h. A few interesting cases are shown below, but feel free to experiment!
Case 1
The initial values of these constants looks like:
#define kMaxHorNTSCIn 320
#define kMaxVerNTSCIn 240
#define kVerBlank 0
#define gMaxSoftVdigCount 1
#define gDoesDepths 0
#define gDoesPlaythru false
#define gHasAuxBuffer false
#define gAuxDepth 16
#define gCanAsync true
#define gCanClip true
#define gCanScale true
#define gCanDMA true
#define gDMADepths 16 | 8
#define gMaxHeight 240
#define gMaxWidth 320
#define gMinHeight 119
#define gMinWidth 159
#define gDoesFrameRate false
#define gVideoTimeScale 2997
#define gDoesCompress false
#define gOnlyDoesCompress false
#define gOnlyCompressType 'rpza'
This configuration will result in the sequence grabber creating an offscreen area for the softvdig to grab into since the digitizer doesn't support any output device (gDoesDepths = 0). The sequence grabber then copies this data onscreen. The VDGrabOneFrame call is used to tell the softVdig to "grab" another frame (in this case drawVideoFrame).
Case 2
Change:
#define gDoesCompress true
#define gOnlyDoesCompress true
This configuration indicates that the vdig can only provide compressed images. During previewing and recording, the softvdig "draws" the frame to the monitor window at the completion of the compression stage (in vdigCompressOneFrameAsync). So the data that you see on the screen is "compressed". You can even notice a difference in the shade of the data in this mode.
Note: In this mode, to see frames on the screen during record, change the code in HackTV.c from:
result = SGSetChannelUsage (gVideoChannel, seqGrabPreview | seqGrabRecord);
to:
result = SGSetChannelUsage (gVideoChannel, seqGrabPreview | seqGrabRecord | seqGrabPlayDuringRecord);
Case 3
Change:
#define gDoesCompress true
#define gOnlyDoesCompress false
This configuration indicates that the vdig can provide both raw image data and compressed data. During previewing, the standard vdigGrabOneFrame is used. While recording, the vdig displays the compressed image to the monitor window.
Note: In this mode, to see frames on the screen during record, change the code in HackTV.c from:
result = SGSetChannelUsage (gVideoChannel, seqGrabPreview | seqGrabRecord);
to:
result = SGSetChannelUsage (gVideoChannel, seqGrabPreview | seqGrabRecord | seqGrabPlayDuringRecord);